<?php

namespace app\advertisement\controller;

use app\common\controller\PCBase;
use app\BaseController;//测试专用
use app\advertisement\logic\AdvertisementCheckLogic;
use think\facade\Db;
use Throwable;
use app\common\library\Upload;

class AdvertisementCheck extends PCBase
{


    public function initialize(): void
    {
        parent::initialize();
    }

    /**
     * index
     * @throws Throwable
     */
    public function index()
    {
        $params     = $this->request->post();
        $AdvertisementCheckLogic = new AdvertisementCheckLogic();
        return $AdvertisementCheckLogic->index($params);
    }

    /**
     * @desc   import
     * @author zhagnheng
     * @date   2024-08-13
     */
    public function import(){
        $file       = $this->request->file('file');
        $res        = (new Upload($file))->upload(null, $this->getAdminId()); 
        $AdvertisementCheckLogic = new AdvertisementCheckLogic();
        return $AdvertisementCheckLogic->import($res['url']);
    }

    /**
     * info
     * @throws Throwable
     */
    public function info()
    {
        $params     = $this->request->post();
        $AdvertisementCheckLogic = new AdvertisementCheckLogic();
        return $AdvertisementCheckLogic->info($params);
    }

    /**
     * ReCheck
     * @throws Throwable
     */
    public function ReCheck()
    {
        $params     = $this->request->post();
        $AdvertisementCheckLogic = new AdvertisementCheckLogic();
        return $AdvertisementCheckLogic->ReCheck($params);
    }

}
